Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve validations & bindings #129

Merged
merged 8 commits into from
Feb 21, 2017
Merged

Improve validations & bindings #129

merged 8 commits into from
Feb 21, 2017

Conversation

icebob
Copy link
Member

@icebob icebob commented Feb 21, 2017

Concerned issues: #128 #109

  1. VFG component emits a validated event, if validation executed. Event parameters: isValid: boolean, errors: Array

Example:

<vue-form-generator @validated="onValidated" />

...

methods:{
  onValidated(isValid, errors) {
   console.log("Validation result: ", isValid, ", Errors:", errors);
  }
}
  1. Fields validation schema.errors issue is fixed. Now errors in the local data. The communication with parent is event-based (similar @validated solution)

  2. Fix this in schema functions. Now this is always the instance of vfg. Parameters: model, fieldSchema, vfg

@icebob icebob added this to the v2.0.0 milestone Feb 21, 2017
@icebob icebob changed the title Improve validations Improve validations & bindings Feb 21, 2017
@icebob icebob mentioned this pull request Feb 21, 2017
@icebob icebob merged commit 6125382 into master Feb 21, 2017
@icebob icebob deleted the validations branch February 21, 2017 19:33
@pimhooghiemstra
Copy link

@icebob nice work!

A couple of quick questions if I may?

  • For my project I installed the npm version of vue-form-generator. Now I'd like to use this new version. I understand it is not on npm (you guys wait for version 2.0.0 I presume?). Currently I just forked and cloned the repo (with latest changes) to my computer, then compiled it and copied the vfg.js, vfg-core.js, vfg-core.css and vfg.css to my project.
    However, I am not sure how to proceed, do I just place those in my node_modules? Haven't tried it , but instead copied them in my own components directory and imported from there. Although this works I am wondering if this is the normal way to do this?

I also noticed that the 'fields' array has changed substantially from the version on npm. I found out because I opened the examples. Is there another way to get to know this (besides looking at the code directly?)

Thanks in advance. I realise that my questions are actually more generic and not specific to this repo...

@icebob
Copy link
Member Author

icebob commented Feb 22, 2017

@pimhooghiemstra I made a new build, so dist files contains modifications from this PR. So you can try this version in your project if you change the version of vfg in package.json to

"vue-form-generator": "icebob/vue-form-generator"

So npm install will download the latest committed files.

Yes, fields list changed, separated to two group (core, optional), removed deprecated fields and dist files renamed. They are a break changes, but we are in beta state, so we don't increment the mayor version.
If you update to a beta version, check the changelog like when you update to a new major version of a lib. The changelog of the next beta release will contain the break changes with example migration codes.

If we release the first stable v2 version, we will follow semver versioning again.

@pimhooghiemstra
Copy link

Great!

Just installed vfg from git instead of npm, did know that it was possible, not yet how to do it, thanks!

I'll check changelog when the new beta version comes out, definitely!

@icebob
Copy link
Member Author

icebob commented Feb 22, 2017

Only use this install method for testing, prototyping because it is always download the latest committed files, which can be unstable too.

@pimhooghiemstra
Copy link

I understand, appreciate the warning! I'll wait for the 2.0.0 release for production anyways ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants